package lab02.Test21;
import java.util.HashMap;
import java.util.Map;

public class count {
    public static void main(String[] args) {
        String str = "eetdaed";
        Map<Character, Integer> map = new HashMap<Character, Integer>();
        for (int i = 0; i < str.length(); i++) {
            Character c = str.charAt(i);
            if (null == map.get(c)) {
                map.put(c, 1);
            } else {
                map.put(c, map.get(c) + 1);
            }
        }

        for (Character key : map.keySet()) {
            System.out.println(key + "=" + map.get(key));
        }
    }
}
